/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.hagopa.games.moneypool.game;

/**
 *
 * @author Igor
 */
public enum ErrorsEnum {
    NO_MONEY	        (1100, "Player has no money for this action"),
    NO_PROPERTY	        (1120, "Player is nor owner of this property"),
    NO_PROPERTIES       (1125, "Player has no properties to sell or mortgage"),
    UNDEFINED_PROP_IND  (1130, "Undefined feild index")
    ;
    private int idx;
    private String name = null;
    ErrorsEnum(int ind, String name)
    {
	this.idx = ind;
	this.name = name;
		
    }
    public static ErrorsEnum getEnum(int idx)
    {
		switch (idx){
                    case 1100:
			return NO_MONEY;
                    case 1120:
			return NO_PROPERTY;
                    case 1125:
                        return NO_PROPERTIES;
                    case 1130:
                        return UNDEFINED_PROP_IND;
                    default:
			return null;
                }
    }
    public int idx()
    {
	return this.idx;
    }
    public String getName()
    {
    	return this.name;
    }
}
